import 'package:flutter_base/base/controller/base_list_more_controller.dart';
import 'package:flutter_base/http/http_export.dart';
import 'package:flutter_base/pages/home/model/model_test_psychology.dart';
import 'package:get/get.dart';

class OrderListLogic extends BaseListMoreController {
  OrderListLogic({required this.typeId});

  final String typeId;

  @override
  void onReady() {
    // TODO: implement onReady
    super.onReady();
  }

  @override
  void onClose() {
    // TODO: implement onClose
    super.onClose();
  }

  @override
  Future<List> loadData() async {
    // TODO: implement loadData
    HttpResponse response = await HttpManager().get(
      API.popularTests,
      params: {
        'page': pageNum,
        'size': pageSize,
        'type_id': typeId,
      },
      fromJson: ModelTestPsychology.fromJson,
      // uiType: refresh ? HttpUIType.toast : HttpUIType.none,
    );
    return response.data ?? [];
  }
//   if (response.isSuccess) {
//   return [1, 1, 1];
//   // return super.loadData();
// }
}
